package code.sbxj.qwd.com.sbxj;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;

import com.jph.takephoto.app.TakePhotoActivity;
import com.kaopiz.kprogresshud.KProgressHUD;

import org.xutils.x;

public class BaseActivity extends TakePhotoActivity {
    KProgressHUD hud;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        x.view().inject(this);
    }

    public void setTitleText(String title) {
        ((TextView) findViewById(R.id.titletv)).setText(title);
    }


    public void ShowLoading() {

        hud = KProgressHUD.create(this)
                .setStyle(KProgressHUD.Style.SPIN_INDETERMINATE)
                .setLabel("请稍等...")
//                .setDetailsLabel("Downloading data")
                .setCancellable(true)
                .setAnimationSpeed(2)
                .setDimAmount(0.5f)
                .show();

    }

    public void CancleLoading() {

        hud.dismiss();
    }

}
